<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>v-if与v-show</title>
		<script src="js/vuejs-2.5.16.js"></script>
	</head>
	<head>
		<meta charset="utf-8" />
		<title>v-if与v-show</title>
		<script src="js/vuejs-2.5.16.js"></script>
	</head>
	<body>
	<div id="app">
		<span v-if="flag">Hello</span>
		<span v-show="flag">itcast</span>
		<button @click="toggle">toggle</button>
	</div>
	</body>
	<script>
		//view model
		new Vue({
			el:"#app",
			data:{
				flag:false
			},
			methods:{
				toggle:function(){
					this.flag = !this.flag;
				}
			}
		})
	</script>
</html>
